/*
 * Copyright (c) 2010-2013 Ruben Chakhmakhchyan. All rights reserved.
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Eclipse Public License
 * Version 1.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://opensource.org/licenses/EPL-1.0 and read it before using this file.
 */

#pragma once

#include "npapi.h"
#include "npruntime.h"


enum class ArrayType { Int, StringUtf8, StringUtf16 };


class ScriptingUtils
{
public:

    static char* npstring( const char* s );
    static char* npstring( const wchar_t* s );
    static wchar_t* npstringToWchar( const NPString* npstring );
    static wchar_t* npstringToWchar( const NPUTF8* chars, uint32_t length );
    static bool npoToArray( NPP npp, NPObject* npo, ArrayType type, void** a );
};
